package com.itheima.dao.impl;

import com.itheima.dao.AccountDao;
import org.apache.commons.dbutils.QueryRunner;

import java.sql.SQLException;

public class AccountDaoImpl implements AccountDao {



    private QueryRunner queryRunner;

    @Override
    public void save() throws SQLException {
        //编写sql语句
        String sql = "update tal_account set username = ?,money = ? where id = ?";

        //设置参数

        Object [] params = {"卢颖超",1000,2};

        //调用方法 执行sql语句
        int result = queryRunner.update(sql, params);

        System.out.println(result);


    }

    public void setQueryRunner(QueryRunner queryRunner) {
        this.queryRunner = queryRunner;
    }
}
